<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<link rel="stylesheet" href="../../app/js/bootstrap-3.3.7-dist/css/bootstrap.min.css" />
		<link rel="stylesheet" type="text/css" href="../../app/css/footer.css" />
		<link rel="stylesheet" href="../../app/css/lystyle.css" />
		<link rel="stylesheet" type="text/css" href="../../app/css/backstage.css" />

		<style type="text/css">
			/*修改底部字体颜色*/
			
			.foot:nth-child(2) {
				color: #e83023;
			}
			
			#wrap div#content {
				padding-top: 1.2rem;
			}
		</style>
		<script src="../../app/js/flexible.min.js" type="text/javascript" charset="utf-8"></script>
	</head>

	<body>
		<div id="wrap">
			<div id="main">
				<div id="header">
					<a id="headImg" href="javascript:history.go(-1)"><img class="headImg" src="../../app/images/12.png" /></a>
					<p id="headTitle">交易记录</p>
				</div>
				<div id="content">
					<div class="search">
						<a href="#" class="glyphicon glyphicon-search"></a>
						<input type="text" name="search" id="search" value="" />
					</div>
					<div class="ly-info">
						<ul class="ly-info-ul">
							<!--<li class="ly-info-li p33">
								<a>
									<p class="ly-font14"><span class="ly-bold">吉林省巴拉</span><span style="float: right;">2017-12-12</span></p>
									<p style="clear: both;margin-top: 0.8rem;" class="ly-font14">如果i软件如果人人让法国人</p>
								</a>
							</li>-->
						</ul>
					</div>
				</div>
			</div>
		</div>
	</body>
	<script src="../../app/js/jquery-2.2.3.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="../../app/js/bootstrap-3.3.7-dist/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="../../app/js/jquery.cookie.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
		var tokenReztApp = $.cookie("tokenReztApp");
		if(!tokenReztApp) {
			window.location.href = "../../app/view/login/login/login.html";
		}
		$(function() {
			currentyf();
		});

		//用户信息
		var user, role, goodsId;
		//获取当前会员信息
		function currentyf() {
			$.ajax({
				cache: false,
				type: "GET",
				url: "http://47.104.13.109/member-service/auth/current?token=" + tokenReztApp,
				dataType: "JSON",
				async: false,
				error: function(XMLHttpRequest, textStatus, errorThrown) {
					$.removeCookie('tokenReztApp', {
						expires: 7,
						path: '/'
					});
					$.removeCookie("tokenRh", {
						expires: 7,
						path: '/'
					});
					$.removeCookie('memberId', {
						expires: 7,
						path: '/'
					});
					$.removeCookie('roleId', {
						expires: 7,
						path: '/'
					});
					window.location.href = "../../app/view/login/login/login.html";
				},
				success: function(data) {
					var check = true;
					for(var i = 0; i < data.roleList.length; i++) {
						var roles = data.roleList[i].id;
						var deadline = new Date(data.roleList[i].deadline);
						if(roles == "f2" && deadline >= new Date()) {
							check = false;
							role = roles; //角色
						}
					}
					if(check) {
						alert("权限不足，请升级为创客！");
						window.location.href = "../../app/view/login/login/login.html";
					}
					user = data.loginName;
					goodsId = data.id;
				}
			});
		}
		$(function() {
			orderList();
		});

		function orderList() {
			$.ajax({
				cache: false,
				type: "GET",
				url: "http://47.104.13.109:80/mall-service/order/list?agencyId=" + goodsId + "&pageNum=1&pageSize=999&orderStatus=1",
				dataType: "JSON",
				async: false,
				error: function(XMLHttpRequest, textStatus, errorThrown) {
					alert("查询订单失败！");
				},
				success: function(data) {
					var a = '';
					for(var i = 0; i < data.list.length; i++) {
						var list = data.list[i];
						a += '<li class="ly-info-li p33"><a href="backstage_orderinfo.html?orderSn=' + list.orderSn + '" ><p class="ly-font14"><span style="text-overflow:ellipsis;white-space: nowrap;overflow: hidden; width:5rem" class="ly-bold">' + list.shopName + '</span><span style="float: right;">' + list.orderDate + '</span></p><p style="clear: both;margin-top: 0.8rem;" class="ly-font14">' + list.shopName + "完成" + list.orderMoney + '订单</p></a></li>'
						$('.ly-info-ul').html(a);
					}
				}
			});
		}
	</script>

</html>